package com.suray.wcs.service.system.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.suray.basic.wcs.path.core.Node;
import com.suray.commin.core.utils.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * @Description:任务接驳点管理配置表
 * @author: chenhw
 * @date:2022年05月09日 下午4:30:08
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName(autoResultMap = true, value = "wcs_connect_config")
public class ConnectConfDB extends BaseModel implements Serializable {
    private static final long serialVersionUID = 1L;
    @TableId(value = "connect_id", type = IdType.AUTO)
    private Integer connectId;

    private String connectName;

    private String preConnect;

    private String sufConnect;

    private Integer connectType;

    /**
     * 提升机设备id(plc_id)
     */
    private Integer lifterId;

    private String portCode;

    private String remark;

    /**
     * 开启接驳标志：0 否；1 是
     */
    private Boolean connectFlag;


    @TableField(exist = false)
    private String[] preConnects;

    @TableField(exist = false)
    private String[] sufConnects;

    public String[] transPreConnect() {
        return Node.parseList(preConnect);
    }

    public String[] transSufConnect(){
        return Node.parseList(sufConnect);
    }
}
